package com.github.gaojh.ioc.bean;

import java.util.List;

/**
 * @author gaojh
 * @since 2020/3/23
 */
public class BeanInitializer extends AbstractInitializer {

    @Override
    public void doInit(ClassScanner classScanner) throws Exception {
        initBeans(classScanner);
    }

    private void initBeans(ClassScanner classScanner) throws Exception{
        List<ClassInfo> classInfos = classScanner.getAllClass();
        for (ClassInfo classInfo : classInfos) {
            createBean(classInfo.getBeanClass());
        }
    }
}
